package com.newmodelclient.baselib.widget;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.FrameLayout;
import android.widget.ProgressBar;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.newmodelclient.baselib.R;

/**
 * 文件名：FCPageLoading
 * 描 述：页面指示器
 * 作 者：gyq
 * 时 间：2021-1-22
 */
public class FCPageLoading extends FrameLayout {

    private ProgressBar mProgressBar;

    public FCPageLoading(@NonNull Context context) {
        super(context);
        LayoutInflater.from(context).inflate(R.layout.view_base_loading,this);
        initUI();
    }

    public FCPageLoading(@NonNull Context context, @Nullable AttributeSet attrs) {
        super(context, attrs);
        LayoutInflater.from(context).inflate(R.layout.view_base_loading,this);
        initUI();
    }

    private void initUI() {
        mProgressBar = findViewById(R.id.v_base_pb);
    }

    public void showProgressLoading() {
        mProgressBar.setVisibility(VISIBLE);
        bringToFront();
    }

    public void hiddenLoading() {
        mProgressBar.setVisibility(GONE);
    }
}
